//height
$(document).ready(function(){
	var $div = $('.wrap');
	var h = $div.outerHeight();

	function setLayout() {
		var vh = $(window).height();
		if ( vh > 660 ) {
			$div.css('margin-top', (vh-h)/2);
		}
	}

	setLayout();

	$(window).on('resize', setLayout);
});

function U(url,params){
	var website = _ROOT_+'/index.php';
	url = url.split('/');
	if(url[0]=='' || url[0]=='@')
		url[0] = APPNAME;
	if (!url[1])
		url[1] = 'Index';
	if (!url[2])
		url[2] = 'index';
	website = website+'?app='+url[0]+'&m='+url[1]+'&a='+url[2];
	if(params){
		params = params.join('&');
		website = website + '&' + params;
	}
	return website;
}
